import fetch, { BaseResponse } from '@/domain/authority/api';
import { ReqParam, ResData } from '../../types/downLoad';
// import { getBaseUrl } from '@/utils/http';

/**
 * 获取下载列表
 * @returns ResMenu
 */
export async function getDownLoadData(param: ReqParam): Promise<BaseResponse<ResData>> {
  const { data } = await fetch.get<BaseResponse<ResData>>('/haichuan/assembly/download/list', { ...param });
  return data;
}

/**
 * 删除下载
 * @returns ResMenu
 */
export async function deleteDownload(download_ids: string): Promise<BaseResponse<string>> {
  const { data } = await fetch.post<BaseResponse<string>>('/haichuan/assembly/download/delete', { download_ids: String(download_ids) });
  return data;
}

export const downLoadUrl = import.meta.env.VITE_API_HAICHUAN_DOMAIN + '/haichuan/assembly/request/download';
// export const downLoadUrl = getBaseUrl('') + '/haichuan/assembly/request/download';
